using System;
using System.Collections.Generic;
using System.Text;
using DOMercury.Interfaces;



namespace DOMercury.Items
{
    /// <summary>
    /// Represents a DOMercury Alias
    /// </summary>
    public class Alias : IComparable, IItem
    {
        private string alias, path, parameters, description;
        //private AliasManager am;

        #region Properties
        /// <summary>
        /// The name of the Alias
        /// </summary>
        public string AliasName
        {
            get
            {
                return alias;
            }
            set
            {
                alias = value;
            }
        }
        /// <summary>
        /// The path of the file or program the alias opens
        /// </summary>
        public string Path
        {
            get
            {
                return path;
            }
            set
            {
                path = value;
            }
        }

        /// <summary>
        /// The Parameters set the alias provides
        /// </summary>
        public string Parameters
        {
            get
            {
                return parameters;
            }
            set
            {
                parameters = value;
            }
        }

        /// <summary>
        /// The description of the Alias
        /// </summary>
        public string Description
        {
            get
            {
                return description;
            }
            set
            {
                description = value;
            }
        }

        /// <summary>
        /// Returns the "alias" type
        /// </summary>
        public string ItemType
        {
            get
            {
                return "alias";
            }
        }

        /// <summary>
        /// Returns the AliasName
        /// </summary>
        public string DisplayName
        {
            get
            {
                return AliasName;
            }
        }

        /// <summary>
        /// Returns the Description
        /// </summary>
        public string DisplayDesc
        {
            get
            {
                return Description;
            }
        }

        /// <summary>
        /// Used to Populate the AliasManager Listbox
        /// </summary>
        /// <returns></returns>
        public override string ToString()
        {
            return alias + ": " + path + ": " + description;
        }
        #endregion

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="Alias">AliasName</param>
        /// <param name="Path">Path to open</param>
        /// <param name="Parameters">parameters to open with</param>
        /// <param name="Descriptions">Description of Alias</param>
        public Alias(string Alias, string Path, string Parameters, string Descriptions)
        {
            alias = Alias;
            path = Path;
            parameters = Parameters;
            description = Descriptions;
        }

        #region IComparable Members

        public int CompareTo(object obj)
        {
            return this.alias.CompareTo(((IItem)(obj)).DisplayName);
        }

        #endregion
    }

}
